﻿using System.ComponentModel.Composition;
using Caliburn.Micro;
using OPSYS_Schematic.UIInfrastructure;

namespace OPSYS_Schematic.Presentation.ViewModels
{
    [Export(typeof (IStatusBarService))]
    public class StatusBarViewModel : ViewAware, IStatusBarService
    {
        private double maximum;
        private string message;

        private double value;

        public string Message
        {
            get { return message; }
            set
            {
                message = value;
                NotifyOfPropertyChange(() => Message);
            }
        }

        public double Value
        {
            get { return value; }
            set
            {
                this.value = value;
                NotifyOfPropertyChange(() => Value);
            }
        }

        public double Maximum
        {
            get { return maximum; }
            set
            {
                maximum = value;
                NotifyOfPropertyChange(() => Maximum);
            }
        }

        #region IStatusBarService Members

        public void ShowMessage(string message)
        {
            Message = message;
        }

        public void ShowProgress(double currentValue, double allValue)
        {
            Value = currentValue;
            Maximum = allValue;
        }

        #endregion
    }
}